<%@page language="Java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="includes/head.jsp" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>User</title>
</head>
<body>
	<f:view>
	<span id="whole-page-wrapper">
			<div id="wrapper" align="center">
			<%@include file="includes/header.jsp" %>
			<%@include file="includes/menu.jsp" %>	
					
				<div id="content">
					<div id="inner-content">
					<c:if test="${sessionScope.user.loggedUser.type == 'Admin' }">
							<h3>Dane użytkownika</h3>
							<div class="leftIndent50px">
								<h4> Imię: </h4>
									<span class="leftIndent30px"><h:outputText value="#{user.selectedUser.name }"/></span><br>
								<h4> Nazwisko: </h4>
									<span class="leftIndent30px"><h:outputText value="#{user.selectedUser.surname }"/></span><br>
								<h4> Adres: </h4>
									<span class="leftIndent30px"><h:outputText value="#{user.selectedUser.address }"/></span><br>
								<h4> Typ: </h4>
									<span class="leftIndent30px"><h:outputText value="#{user.selectedUser.type }"/></span><br><br>
							</div>
							<h:form >
								<input type="hidden" value="${sessionScope.users[param.id].id }" name="userID" />
								<h:commandButton action="#{user.removeUser}" value="Usuń użytkownika z bazy danych" />
							</h:form>
						</c:if>
						<c:if test="${sessionScope.user.loggedUser.type != 'Admin' }">
							Nie masz uprawnień do korzystania z tej strony!
						</c:if>
					</div>
				</div>
				<%@include file="includes/footer.jsp" %>
			</div>
		</span>
		</f:view>
</body>
</html>